package chucun;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import util.DBUtil;


public class exam {

	
	public static void main(String args[]) {
		Connection con;
		Statement stmt;
		ResultSet rs;
		try {
			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
		} catch (ClassNotFoundException e) {
			System.out.println("" + e);
		}
		try {
			con = DriverManager.getConnection("jdbc:derby:shujuku;create=true");
			stmt = con.createStatement();
			rs = stmt.executeQuery("SELECT * FROM users");
			while (rs.next()) {
				String number = rs.getString(1);
				String name = rs.getString(2);
				String num = rs.getString(3);
				String num2 = rs.getString(4);
				
				System.out.println(number + "," + name + ","+ num + ","+num2 + ",");
			}
			con.close();
		} catch (SQLException e) {
			System.out.println(e);
		}
	}
}
